﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
<script type="text/javascript" src="${path }/resource/js/fygl.js"></script>
<!-- 文件上传需要的样式 -->
<link rel="stylesheet" type="text/css"
	href="${path }/resource/plugin/kindeditor/themes/default/default.css" />
<link rel="stylesheet" type="text/css"
	href="${path }/resource/plugin/kindeditor/plugins/code/prettify.css" />
<script type="text/javascript"
	src="${path }/resource/plugin/kindeditor/kindeditor.js"></script>
<script type="text/javascript"
	src="${path }/resource/plugin/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript"
	src="${path }/resource/plugin/kindeditor/plugins/code/prettify.js"></script>
<style type="text/css">
.litterInput {
	width: 80%;
	float: left;
	text-align: center;
}
.img_box {
	float: left;
	width: 152px;
	border: 1px solid #aeaeae;
	display: none;
	overflow: hidden;
	margin-right: 3px;
}

.img_box i {
	font-size: 20px;
	float: right;
	cursor: pointer;
}

.img_box i:HOVER {
	color: #f0ad4e;
}
</style>
<title></title>
</head>
<body>

	<form class="form-horizontal" id="dataform"
		onsubmit="javascripr:return false;">
		<input type="hidden" name="tokenUrl" value="${tokenUrl}"> <input
			type="hidden" name="token" value="${token}">
		<c:if test="${obj ne null }">
			<input type="hidden" name="id" value="${obj.id }">
		</c:if>

		<div class="ibox ">
			<div class="ibox-title">
				<h5>房源基本信息</h5>
			</div>

			<div class="ibox-content">
				<div class="form-group">
					<label class="col-sm-2 control-label">房屋类型:</label>
					<div class="col-sm-4">
						<input class="form-control" value="${obj.fyKinds}" name="fyKinds" readonly="readonly"/>
					</div>
					<label class="col-sm-2 control-label">供求:</label>
					<div class="col-sm-4">
						<input class="form-control" value="${obj.fyGq}" name="fyGq" readonly="readonly"/>
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-2 control-label">标题<span
						class="text-danger"> *</span></label>
					<div class="col-sm-8">
						<input class="form-control" value="${obj.fyTitle}" name="fyTitle"
							dataType="*1-500" nullmsg="标题不能为空" />
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">期望地区<span
						class="text-danger"> *</span></label>
					<div class="col-sm-8">
						<input class="form-control" value="${obj.qzqgArea}"
							name="qzqgArea" dataType="*1-200" nullmsg="求购地区不能为空" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">商铺类型<span
						class="text-danger"> *</span></label>
					<div class="col-sm-4">
						<select class="form-control autoFull " name="spType"
							data-filed="name" data-value="name" data-def="${obj.spType}"
							data-url="${path}/admin/dataDictionary/showDataDictionary"
							data-param="{type:'商铺类型'}">
							<option value=''>--请选择商铺类型--</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">经营行业<span
						class="text-danger"> *</span></label>
						<div class="col-sm-4">
							<input class="form-control" value="${obj.spJynr}" name="spJynr"
								dataType="*1-500" nullmsg="经营行业不能为空" />
					</div>
				</div>
				<c:if test="${obj.fyGq eq '求购'}" >
				<div class="form-group">
					<label class="col-sm-2 control-label">期望价格<span
						class="text-danger"> *</span></label>
					<div class="col-sm-8">
						<div class="row">
							<div class="col-sm-4">
								<input class="form-control litterInput" maxlength="10"
									value="${obj.qzqgPriceMin}" name="qzqgPriceMin" dataType="*1-20" />
								<p class="form-control-static">&nbsp;万 到</p>
							</div>
							<div class="col-sm-4">
								<input class="form-control litterInput" maxlength="10"
									value="${obj.qzqgPriceMax}" name="qzqgPriceMax" dataType="*1-20" />
								<p class="form-control-static">&nbsp;万</p>
							</div>
						</div>
					</div>
				</div>
				</c:if>
				<c:if test="${obj.fyGq eq '求租'}" >
				<div class="form-group">
					<label class="col-sm-2 control-label">期望租金<span
						class="text-danger"> *</span></label>
					<div class="col-sm-8">
						<div class="row">
							<div class="col-sm-4">
								<input class="form-control litterInput" maxlength="10"
									value="${obj.qzqgPriceMin}" name="qzqgPriceMin" dataType="*1-20" />
								<p class="form-control-static">&nbsp; 到</p>
							</div>
							<div class="col-sm-4">
								<input class="form-control litterInput" maxlength="10"
									value="${obj.qzqgPriceMax}" name="qzqgPriceMax" dataType="*1-20" />
								<p class="form-control-static">&nbsp;/月</p>
							</div>
						</div>
					</div>
				</div>
				</c:if>
				<div class="form-group">
					<label class="col-sm-2 control-label">期望面积<span
						class="text-danger">*</span></label>
					<div class="col-sm-8">
						<div class="row">
							<div class="col-sm-4">
								<input class="form-control litterInput" maxlength="10"
									value="${obj.qzqgAreaCountMin}" name="qzqgAreaCountMin" dataType="price" />
								<h3 class="form-control-static">㎡ 到</h3>
							</div>
							<div class="col-sm-4">
								<input class="form-control litterInput" maxlength="10"
									value="${obj.qzqgAreaCountMax}" name="qzqgAreaCountMax" dataType="price" />
								<h3 class="form-control-static">㎡</h3>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="ibox ">
			<div class="ibox-title">
				<h5>房源个性描述</h5>
			</div>
			<div class="ibox-content">
				<div class="form-group">
					<label class="col-sm-2 control-label">详细介绍</label>
					<div class="col-sm-8">
						<textarea name="fyDescription" id="artcontent">${obj.fyDescription}</textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">房源主图</label>
					<div class="col-sm-9">
						<input onclick="MTools.chooesFile('#fileText')"
							class="input-text upload-url radius form-control" type="text"
							id="showFileName" readonly style="width: 30%; display: inline;">
						<a onclick="MTools.chooesFile('#fileText')"
							class="btn btn-primary radius"> <i class="fa fa-cloud-upload"></i>
							上传图片
						</a> <a id="selectInServices" class="btn btn-primary radius"> <i
							class="fa fa-cloud"></i> 远程图库
						</a>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label"></div>
					<div class="col-sm-9">
						<c:if test="${obj ne null }">
							<input type="hidden" value="${obj.fyImage }" name="fyImage"
								id="hiddenImg" />
							<img width="150" id='img_1' src="${obj.fyImage }" />
						</c:if>
						<c:if test="${obj eq null }">
							<input type="hidden" name="fyImage" id="hiddenImg" />
							<img width="150" id='img_1' style="display: none" />
						</c:if>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">其他图片</label>
					<div class="col-sm-9">
						<input onclick="chooesFile2()"
							class="input-text upload-url radius form-control" type="text"
							id="showFileName" readonly style="width: 30%; display: inline;">
						<a onclick="chooesFile2()" class="btn btn-primary radius"> <i
							class="fa fa-cloud-upload"></i> 上传图片
						</a> <a id="selectInServices2" class="btn btn-primary radius"> <i
							class="fa fa-cloud"></i> 远程图库
						</a><span class="text-info">最多可以上传7张</span>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label"></div>
					<div class="col-sm-9" id="photos">
						<input type="hidden" name="photoList[2].url" id="hiddenImg_2" />
						<input type="hidden" name="photoList[3].url" id="hiddenImg_3" />
						<input type="hidden" name="photoList[4].url" id="hiddenImg_4" />
						<input type="hidden" name="photoList[5].url" id="hiddenImg_5" />
						<input type="hidden" name="photoList[6].url" id="hiddenImg_6" />
						<input type="hidden" name="photoList[7].url" id="hiddenImg_7" />
						<input type="hidden" name="photoList[8].url" id="hiddenImg_8" />
						<div class="img_box" id="imgbox_2">
							<img width="150" id='img_2' /> <i class="fa fa-trash"></i>
						</div>
						<div class="img_box" id="imgbox_3">
							<img width="150" id='img_3' /> <i class="fa fa-trash"></i>
						</div>
						<div class="img_box" id="imgbox_4">
							<img width="150" id='img_4' /> <i class="fa fa-trash"></i>
						</div>
						<div class="img_box" id="imgbox_5">
							<img width="150" id='img_5' /> <i class="fa fa-trash"></i>
						</div>
						<div class="img_box" id="imgbox_6">
							<img width="150" id='img_6' /> <i class="fa fa-trash"></i>
						</div>
						<div class="img_box" id="imgbox_7">
							<img width="150" id='img_7' /> <i class="fa fa-trash"></i>
						</div>
						<div class="img_box" id="imgbox_8">
							<img width="150" id='img_8' /> <i class="fa fa-trash"></i>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="ibox ">
			<div class="ibox-title">
				<h5>联系方式</h5>
			</div>
			<div class="ibox-content">
				<div class="form-group">
					<label class="col-sm-2 control-label">联系人<span
						class="text-danger"> *</span></label>
					<div class="col-sm-4">
						<input class="form-control" value="${obj.fyLxr}" name="fyLxr"
							dataType="*1-50" nullmsg="联系人不能为空" />
					</div>
					<label class="col-sm-2 control-label">联系电话<span
						class="text-danger"> *</span></label>
					<div class="col-sm-4">
						<input class="form-control" value="${obj.fyLxdh}" name="fyLxdh"
							dataType="m" nullmsg="联系电话不能为空" />
					</div>
				</div>
			</div>
		</div>

		<div class="ibox ">
			<div class="ibox-title">
				<h5>管理信息</h5>
			</div>
			<div class="ibox-content">
				<div class="form-group">
					<label class="col-sm-2 control-label">发布状态<span
						class="text-danger"> *</span></label>
					<div class="col-sm-4">
						<select class="form-control autoFull " name="glPublishStatus"
							data-filed="name" data-value="name"
							data-def="${obj.glPublishStatus}"
							data-url="${path}/admin/dataDictionary/showDataDictionary"
							data-param="{type:'发布状态'}">
						</select>
					</div>
					<label class="col-sm-2 control-label">置顶<span
						class="text-danger"> *</span></label>
					<div class="col-sm-4">
						<select class="form-control  " name="glIsTop">
							<option
								<c:if test="${obj.glIsTop eq '是'}"> selected="selected"</c:if>
								value='是'>是</option>
							<option
								<c:if test="${obj.glIsTop eq '否'}"> selected="selected"</c:if>
								value='否'>否</option>
						</select>
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-2 control-label">房源来源:</label>
					<div class="col-sm-4">
						<p class="form-control-static">${obj.fySource}</p>
					</div>
					<label class="col-sm-2 control-label">审核备注:</label>
					<div class="col-sm-4">
						<p class="form-control-static">${obj.glCheckRemark}</p>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group ">
			<div class="col-sm-12 text-center">
				<a href="javascript:;" onclick="myForm.submit()"
					class="btn btn-success radius">保存</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<c:if test="${flag==2}">
					<button
						onclick="MTools.handleItem('${path}/admin/fy/fyCheckPass?id=${obj.id}','确认审核吗？',flashGrid)"
						class="btn btn-info radius">审核通过</button>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<button onclick="noCheck(${obj.id})"
						class="btn btn-warning radius">审核驳回</button>
				</c:if>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<button onclick="MTools.closeForm()" class="btn btn-danger radius">取消</button>
			</div>
		</div>
	</form>
	<form class="form form-horizontal" method="post" style="display: none;"
		enctype="multipart/form-data" target="blankFrame"
		action="${path }/resource/plugin/kindeditor/upload_json.jsp?dir=image&flag=img_1&hiddenImg=hiddenImg">
		<input id="fileText" type="file" multiple name="file-1"
			onchange="fileChange()" /> <input type="submit" id="submitBtn" />
	</form>

	<form class="form form-horizontal" method="post" style="display: none;"
		id="imgsForm" enctype="multipart/form-data" target="blankFrame">
		<input id="fileText2" type="file" multiple name="file-1"
			onchange="fileChange2()" /> <input type="submit" id="submitBtn2" />
	</form>

	<iframe src="" name="blankFrame" id="blankFrame"
		style="height: 100px; width: 100px; display: none;"> </iframe>

	<script type="text/javascript">
		var myForm, editor;
		$(function() {
			//初始化
			MTools.autoFullSelect();
			editor = MUI.createEdit("fyDescription", '100%', '200px', 'editor');
			MUI.openServiceImgSpace(function(url) {
				$("#img_1").attr("src", url).show();
				$("#hiddenImg").val(url);
			}, "#selectInServices");
			myForm = MForm.initForm({
				invokeUrl : "${path}/admin/fy/addOrModify",
				beforeSubmit : function() {
					editor.sync();
				},
				afterSubmit : function() {
					parent.myGrid.serchData();
				},
			});

		})
	</script>
</body>
</html>